$(function(){
	//判断时间大小
	$.validator.methods.compareDate = function(value,element,param){
		var startDate = $(param).val();
        return value > startDate;
	};
	//密码确认
	$.validator.methods.validatePassword = function(value,element,param){
		var newPassword = $(param).val();
        return value == newPassword;
	};
	//邮政编码验证
	$.validator.addMethod("isZipCode", function(value, element) {  
	    var tel = /^[0-9]{6}$/;
	    return this.optional(element) || (tel.test(value));
	}, "请正确填写您的邮政编码");

	//电话号码验证(手机号、固话)
	$.validator.addMethod("ismobile", function(value, element) {  
	     var length = value.length;     
	     var mobile = /^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0-9]|170)\d{8}$/; 
	     var tel = /^\d{3}-?\d{8}$/;
	     var tel1 = /^\d{4}-?\d{8}$/;
	     if(length == 11 && mobile.exec(value)){
	    	 return true;
	     }
	     if(tel.exec(value) || tel1.exec(value)){
			return true;
		}
	     return false;  
	 }, "请正确填写您的联系电话(固定电话请加上区号)"); 
	
});